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.y: C = None
        self.v: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

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

k.t = e
c.o = i
c.v = i
c.y = l
l.w = c
j.t = i
j.z = i
j.u = c
j.w = c
j.v = k
j.q = l
i.s = l
i.u = k
i.v = c
e.q = k
e.w = j
e.s = j
assert j.t.u.t.q.t.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.y: C = None
        self.v: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

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

k.t = e
c.o = i
c.v = i
c.y = l
l.w = c
j.t = i
j.z = i
j.u = c
j.w = c
j.v = k
j.q = l
i.s = l
i.u = k
i.v = c
e.q = k
e.w = j
e.s = j
assert j.t.u.t.q.t.txt == "e"