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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: E = None
        self.y: B = None
        self.z: B = None
        self.s: F = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
h = C("h")
f = D("f")
a = E("a")
b = F("b")
e = E("e")
m = D("m")
j = B("j")

d.r = f
d.o = l
l.o = j
l.y = j
l.z = j
l.q = e
l.s = b
h.z = d
f.v = a
a.y = h
a.w = b
a.u = l
a.o = l
a.r = d
a.p = j
b.w = h
b.r = e
e.y = h
e.w = b
e.u = l
e.p = l
e.r = d
e.o = j
m.v = e
j.o = l
j.y = l
j.z = l
j.q = e
j.s = b
assert h.z.r.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: E = None
        self.y: B = None
        self.z: B = None
        self.s: F = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
h = C("h")
f = D("f")
a = E("a")
b = F("b")
e = E("e")
m = D("m")
j = B("j")

d.r = f
d.o = l
l.o = j
l.y = j
l.z = j
l.q = e
l.s = b
h.z = d
f.v = a
a.y = h
a.w = b
a.u = l
a.o = l
a.r = d
a.p = j
b.w = h
b.r = e
e.y = h
e.w = b
e.u = l
e.p = l
e.r = d
e.o = j
m.v = e
j.o = l
j.y = l
j.z = l
j.q = e
j.s = b
assert h.z.r.v.y.txt == "h"