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

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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