class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.x: B = None
        self.o: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: A = None
        self.q: E = None
        self.y: A = None
        self.r: A = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: F = None
        self.q: C = None
        self.s: C = None
        self.p: E = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.x: B = None
        self.o: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: A = None
        self.q: E = None
        self.y: A = None
        self.r: A = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: F = None
        self.q: C = None
        self.s: C = None
        self.p: E = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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