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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.p: A = None
        self.o: E = None
        self.u: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: A = None
        self.u: C = None
        self.txt = txt

k = A("k")
c = B("c")
m = C("m")
g = D("g")
d = E("d")
e = F("e")

k.t = e
c.s = e
c.t = d
c.o = d
c.u = d
c.p = k
m.v = k
m.s = k
m.o = k
m.z = g
m.w = d
m.p = e
g.u = k
g.s = c
g.w = c
d.o = e
d.u = c
d.z = m
e.v = m
e.u = m
e.r = k
assert c.p.t.r.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.p: A = None
        self.o: E = None
        self.u: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: A = None
        self.u: C = None
        self.txt = txt

k = A("k")
c = B("c")
m = C("m")
g = D("g")
d = E("d")
e = F("e")

k.t = e
c.s = e
c.t = d
c.o = d
c.u = d
c.p = k
m.v = k
m.s = k
m.o = k
m.z = g
m.w = d
m.p = e
g.u = k
g.s = c
g.w = c
d.o = e
d.u = c
d.z = m
e.v = m
e.u = m
e.r = k
assert c.p.t.r.t.r.txt == "k"