class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: A = None
        self.q: F = None
        self.y: A = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: A = None
        self.q: F = None
        self.y: A = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

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

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

b.t = l
j.r = b
j.o = i
c.p = l
c.v = a
c.t = i
c.r = b
l.w = f
l.r = c
f.x = m
f.q = m
f.o = b
f.y = b
f.u = l
f.s = l
m.x = f
m.s = f
m.o = l
m.q = i
m.t = b
m.z = b
i.r = b
i.o = j
a.p = l
a.v = c
a.t = i
a.r = b
assert b.t.w.s.r.r.t.r.t.txt == "i"