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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: G = None
        self.u: B = None
        self.o: E = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: G = None
        self.s: E = None
        self.r: A = None
        self.y: G = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: D = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: G = None
        self.u: E = None
        self.w: G = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

m = A("m")
n = B("n")
b = C("b")
g = D("g")
c = E("c")
l = F("l")
k = G("k")
e = H("e")
j = G("j")

m.o = c
m.p = g
m.v = g
m.u = g
m.w = b
m.z = l
n.o = e
n.z = m
b.z = e
b.y = j
b.u = n
b.o = c
b.q = c
g.u = l
g.z = l
g.v = k
g.y = k
g.s = c
g.r = m
c.s = m
l.q = n
l.v = g
l.z = k
k.u = l
e.s = m
e.v = j
e.w = j
e.u = c
e.o = b
e.q = n
j.u = l
assert k.u.z.u.z.u.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: D = None
        self.w: C = None
        self.v: D = None
        self.u: D = None
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: G = None
        self.u: B = None
        self.o: E = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: G = None
        self.s: E = None
        self.r: A = None
        self.y: G = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: D = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: G = None
        self.u: E = None
        self.w: G = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

m = A("m")
n = B("n")
b = C("b")
g = D("g")
c = E("c")
l = F("l")
k = G("k")
e = H("e")
j = G("j")

m.o = c
m.p = g
m.v = g
m.u = g
m.w = b
m.z = l
n.o = e
n.z = m
b.z = e
b.y = j
b.u = n
b.o = c
b.q = c
g.u = l
g.z = l
g.v = k
g.y = k
g.s = c
g.r = m
c.s = m
l.q = n
l.v = g
l.z = k
k.u = l
e.s = m
e.v = j
e.w = j
e.u = c
e.o = b
e.q = n
j.u = l
assert k.u.z.u.z.u.z.u.txt == "l"