AlgoLensArena
ContestlərProblemlərOtaqlar
Vizualizator
← Məsələlər

DAPC25-089.Hidden Sequence

Medium · 4 s · 256 MB

  • icpc
  • dapc
  • 2025

Three players are having a game night, playing a long sequence of different games. In each game, one of the three players wins. In order to keep track of the order of winners, each of the three players decides to keep a list of all winners in order. However, due to the dopamine rush as the result of winning a game, everyone always forgets to write themselves on their own list of winners. Thus, the list of player 111 only contains the order in which players 222 and 333 won the different games, the list of player 222 only contains the order in which players 111 and 333 won, and the list of player 333 only contains the order in which players 111 and 222 won.

Given these three lists, determine the actual order in which all three players won their games.

Giriş formatı

The input consists of:

• Three lines, the iiith of which contains a string sis_isi​ (1≤∣si∣≤1051 \leq |s_i| \leq 10^51≤∣si​∣≤105), the order in which the two players different from iii won their games.

It is guaranteed that it is always possible to determine the unique order in which all three players won their games.

Çıxış formatı

Output a single string containing the order in which all three players won their games.

Qeyd

Source: Delft Algorithm Programming Contest 2025 · Author: Mike de Vries · License: CC BY-SA 4.0 · Original: https://dapc.wisv.ch · Statement adapted for AlgoLens and shared under the same license. · 10 of the 79 original test cases (the largest) are omitted here to keep the problem lightweight.

Nümunələr

Giriş #1

2
1
21

Çıxış #1

21

Giriş #2

23
13
12

Çıxış #2

123

Giriş #3

23232323
11331133
12121212

Çıxış #3

121323121323