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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: F = None
        self.u: F = None
        self.s: H = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: F = None
        self.y: F = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.o: H = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: C = None
        self.txt = txt

d = A("d")
k = B("k")
c = C("c")
l = D("l")
n = E("n")
m = F("m")
a = G("a")
e = H("e")

d.x = c
d.z = l
d.q = l
d.u = k
d.p = k
d.w = k
d.o = a
k.p = n
k.q = m
k.u = m
k.s = e
k.w = c
c.r = l
c.q = m
c.y = m
c.x = d
l.z = d
l.o = k
n.v = a
m.w = d
m.y = d
m.o = e
m.v = l
a.r = n
a.z = m
a.u = k
e.w = m
e.o = c
assert n.v.u.s.o.x.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: D = None
        self.u: B = None
        self.p: B = None
        self.o: G = None
        self.q: D = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: F = None
        self.u: F = None
        self.s: H = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: F = None
        self.y: F = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.o: H = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: C = None
        self.txt = txt

d = A("d")
k = B("k")
c = C("c")
l = D("l")
n = E("n")
m = F("m")
a = G("a")
e = H("e")

d.x = c
d.z = l
d.q = l
d.u = k
d.p = k
d.w = k
d.o = a
k.p = n
k.q = m
k.u = m
k.s = e
k.w = c
c.r = l
c.q = m
c.y = m
c.x = d
l.z = d
l.o = k
n.v = a
m.w = d
m.y = d
m.o = e
m.v = l
a.r = n
a.z = m
a.u = k
e.w = m
e.o = c
assert n.v.u.s.o.x.z.z.z.txt == "l"