class A:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: A = None
        self.y: F = None
        self.r: J = None
        self.z: F = None
        self.v: G = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: C = None
        self.y: J = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: H = None
        self.y: D = None
        self.z: B = None
        self.v: A = None
        self.t: B = None
        self.s: D = None
        self.u: D = None
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: I = None
        self.r: G = None
        self.p: B = None
        self.s: I = None
        self.o: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: G = None
        self.u: A = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: G = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

i.x = c
g.t = h
g.q = h
n.t = i
n.u = i
n.y = h
n.z = h
n.r = c
n.v = k
n.p = b
b.p = g
b.x = n
b.y = c
b.o = i
d.q = c
d.r = c
d.o = e
d.y = b
d.s = b
d.u = b
d.z = g
d.t = g
d.v = i
h.t = f
h.u = f
h.s = f
h.r = k
h.p = g
h.o = c
k.q = n
e.v = g
e.y = k
e.t = k
e.r = k
e.u = i
f.z = h
f.u = k
f.v = c
c.u = h
assert i.x.u.s.z.p.q.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: A = None
        self.y: F = None
        self.r: J = None
        self.z: F = None
        self.v: G = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: C = None
        self.y: J = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: H = None
        self.y: D = None
        self.z: B = None
        self.v: A = None
        self.t: B = None
        self.s: D = None
        self.u: D = None
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: I = None
        self.r: G = None
        self.p: B = None
        self.s: I = None
        self.o: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: G = None
        self.u: A = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: G = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

i.x = c
g.t = h
g.q = h
n.t = i
n.u = i
n.y = h
n.z = h
n.r = c
n.v = k
n.p = b
b.p = g
b.x = n
b.y = c
b.o = i
d.q = c
d.r = c
d.o = e
d.y = b
d.s = b
d.u = b
d.z = g
d.t = g
d.v = i
h.t = f
h.u = f
h.s = f
h.r = k
h.p = g
h.o = c
k.q = n
e.v = g
e.y = k
e.t = k
e.r = k
e.u = i
f.z = h
f.u = k
f.v = c
c.u = h
assert i.x.u.s.z.p.q.o.u.txt == "h"