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

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

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

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

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

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

a = A("a")
b = B("b")
g = C("g")
c = D("c")
d = E("d")
n = F("n")

a.z = g
a.t = g
a.w = g
a.x = g
a.y = b
b.x = c
g.u = a
g.z = a
g.v = a
g.t = a
g.s = c
c.w = g
c.z = d
d.q = c
d.o = c
d.s = c
d.u = b
d.w = a
d.x = g
n.v = d
assert g.v.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: B = None
        self.t: C = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

a = A("a")
b = B("b")
g = C("g")
c = D("c")
d = E("d")
n = F("n")

a.z = g
a.t = g
a.w = g
a.x = g
a.y = b
b.x = c
g.u = a
g.z = a
g.v = a
g.t = a
g.s = c
c.w = g
c.z = d
d.q = c
d.o = c
d.s = c
d.u = b
d.w = a
d.x = g
n.v = d
assert g.v.y.x.txt == "c"