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

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

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

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

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

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

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

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

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

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

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

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

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

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

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