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

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

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

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

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

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

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

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

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

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

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

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

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

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

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