class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.p: E = None
        self.r: I = None
        self.u: D = None
        self.q: G = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: I = None
        self.p: F = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.x: F = None
        self.t: A = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: C = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.x: C = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

e = A("e")
g = B("g")
d = C("d")
c = D("c")
i = E("i")
a = F("a")
h = G("h")
f = H("f")
k = I("k")

e.t = g
e.y = c
e.u = c
e.p = i
e.r = k
e.q = h
e.s = h
g.q = c
g.u = k
g.p = a
g.y = f
d.u = c
d.t = g
c.o = a
c.q = a
c.x = a
c.t = e
c.u = h
i.w = h
i.x = a
a.x = i
a.t = d
a.p = d
h.p = e
h.s = g
h.x = d
h.u = d
f.y = e
k.p = g
assert d.t.y.y.r.p.q.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.p: E = None
        self.r: I = None
        self.u: D = None
        self.q: G = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: I = None
        self.p: F = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.x: F = None
        self.t: A = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: C = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.x: C = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

e = A("e")
g = B("g")
d = C("d")
c = D("c")
i = E("i")
a = F("a")
h = G("h")
f = H("f")
k = I("k")

e.t = g
e.y = c
e.u = c
e.p = i
e.r = k
e.q = h
e.s = h
g.q = c
g.u = k
g.p = a
g.y = f
d.u = c
d.t = g
c.o = a
c.q = a
c.x = a
c.t = e
c.u = h
i.w = h
i.x = a
a.x = i
a.t = d
a.p = d
h.p = e
h.s = g
h.x = d
h.u = d
f.y = e
k.p = g
assert d.t.y.y.r.p.q.u.s.txt == "g"