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

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

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

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

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

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

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

l.t = d
f.s = i
f.w = d
f.q = j
k.x = j
k.w = j
k.t = d
k.z = l
k.r = l
k.q = f
m.q = i
i.t = l
i.q = d
i.x = f
i.w = m
c.x = i
e.x = i
d.q = i
j.x = k
j.w = k
j.t = m
j.z = l
j.r = l
j.q = f
assert l.t.q.t.t.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

l.t = d
f.s = i
f.w = d
f.q = j
k.x = j
k.w = j
k.t = d
k.z = l
k.r = l
k.q = f
m.q = i
i.t = l
i.q = d
i.x = f
i.w = m
c.x = i
e.x = i
d.q = i
j.x = k
j.w = k
j.t = m
j.z = l
j.r = l
j.q = f
assert l.t.q.t.t.q.w.txt == "m"