class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: D = None
        self.x: F = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.q: A = None
        self.t: E = None
        self.v: A = None
        self.txt = txt

a = A("a")
b = B("b")
d = C("d")
f = D("f")
c = E("c")
k = F("k")

a.w = d
a.r = f
b.s = k
b.x = k
b.y = k
b.o = f
d.o = f
f.w = a
f.z = a
f.v = k
f.x = k
f.u = b
c.y = a
c.w = a
c.t = b
c.o = f
k.y = b
k.p = f
k.q = a
k.v = a
k.t = c
assert c.t.o.x.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: D = None
        self.x: F = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.q: A = None
        self.t: E = None
        self.v: A = None
        self.txt = txt

a = A("a")
b = B("b")
d = C("d")
f = D("f")
c = E("c")
k = F("k")

a.w = d
a.r = f
b.s = k
b.x = k
b.y = k
b.o = f
d.o = f
f.w = a
f.z = a
f.v = k
f.x = k
f.u = b
c.y = a
c.w = a
c.t = b
c.o = f
k.y = b
k.p = f
k.q = a
k.v = a
k.t = c
assert c.t.o.x.t.o.txt == "f"