class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.u: E = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: F = None
        self.v: B = None
        self.o: F = None
        self.w: D = None
        self.u: B = None
        self.x: D = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: A = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: A = None
        self.v: D = None
        self.u: E = None
        self.o: B = None
        self.r: C = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

k = A("k")
j = B("j")
c = C("c")
l = D("l")
d = E("d")
b = F("b")
h = G("h")
g = H("g")

k.p = c
k.t = c
k.w = c
k.u = d
j.z = d
j.r = k
c.s = b
c.z = h
c.u = d
c.q = d
l.w = j
l.r = h
d.z = c
d.s = b
d.o = b
d.v = j
d.u = j
d.w = l
d.x = l
d.t = g
b.y = l
b.u = l
h.w = l
h.v = k
h.s = b
g.w = b
g.z = b
g.y = k
g.v = l
g.u = d
g.o = j
g.p = j
g.r = c
assert k.u.u.z.x.w.z.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.u: E = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: F = None
        self.v: B = None
        self.o: F = None
        self.w: D = None
        self.u: B = None
        self.x: D = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: A = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: A = None
        self.v: D = None
        self.u: E = None
        self.o: B = None
        self.r: C = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

k = A("k")
j = B("j")
c = C("c")
l = D("l")
d = E("d")
b = F("b")
h = G("h")
g = H("g")

k.p = c
k.t = c
k.w = c
k.u = d
j.z = d
j.r = k
c.s = b
c.z = h
c.u = d
c.q = d
l.w = j
l.r = h
d.z = c
d.s = b
d.o = b
d.v = j
d.u = j
d.w = l
d.x = l
d.t = g
b.y = l
b.u = l
h.w = l
h.v = k
h.s = b
g.w = b
g.z = b
g.y = k
g.v = l
g.u = d
g.o = j
g.p = j
g.r = c
assert k.u.u.z.x.w.z.w.r.txt == "h"