class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: B = None
        self.o: A = None
        self.w: F = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: B = None
        self.v: B = None
        self.u: A = None
        self.p: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: B = None
        self.o: A = None
        self.w: F = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: B = None
        self.v: B = None
        self.u: A = None
        self.p: A = None
        self.z: D = None
        self.txt = txt

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

k.x = d
k.y = d
d.t = e
e.v = d
e.r = d
e.x = b
e.z = g
e.y = g
e.t = k
g.t = b
g.w = b
g.r = d
g.v = d
g.o = k
c.x = b
b.x = k
b.u = k
b.p = k
b.w = d
b.v = d
b.z = g
assert e.x.w.t.v.t.txt == "e"