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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

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