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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: C = None
        self.w: A = None
        self.y: B = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: C = None
        self.w: A = None
        self.y: B = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

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

k.t = l
m.o = i
d.q = k
d.s = m
a.r = d
a.u = d
a.w = k
a.p = i
a.z = m
a.t = b
i.t = a
i.v = a
i.s = d
i.w = k
i.y = m
l.s = k
l.u = k
l.y = k
l.w = i
b.r = d
b.u = d
b.w = k
b.p = i
b.z = m
b.t = a
assert i.t.w.t.s.t.w.s.txt == "d"