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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.s: A = None
        self.x: E = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.r: B = None
        self.p: C = None
        self.txt = txt

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

h.q = k
h.z = e
i.q = h
i.v = k
j.o = k
f.z = e
f.r = j
f.s = h
f.x = k
f.v = b
k.z = f
k.q = m
b.t = f
b.x = h
b.r = m
b.p = j
e.q = h
e.v = k
d.q = h
d.v = k
a.t = f
a.x = h
a.r = i
a.p = j
m.q = h
m.v = k
assert e.v.z.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.s: A = None
        self.x: E = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.r: B = None
        self.p: C = None
        self.txt = txt

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

h.q = k
h.z = e
i.q = h
i.v = k
j.o = k
f.z = e
f.r = j
f.s = h
f.x = k
f.v = b
k.z = f
k.q = m
b.t = f
b.x = h
b.r = m
b.p = j
e.q = h
e.v = k
d.q = h
d.v = k
a.t = f
a.x = h
a.r = i
a.p = j
m.q = h
m.v = k
assert e.v.z.v.r.txt == "m"