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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: D = None
        self.o: E = None
        self.y: D = None
        self.txt = txt

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

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

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

c = A("c")
m = B("m")
j = C("j")
g = D("g")
e = E("e")
b = F("b")

c.w = m
c.o = e
c.t = b
c.p = b
c.x = b
c.q = g
m.y = b
m.s = e
m.x = e
m.t = j
m.r = g
j.z = c
j.p = g
j.y = g
j.o = e
g.x = e
e.s = j
e.v = c
e.w = c
e.z = g
b.w = m
b.t = m
assert m.x.z.x.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: E = None
        self.t: F = None
        self.p: F = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: D = None
        self.o: E = None
        self.y: D = None
        self.txt = txt

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

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

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

c = A("c")
m = B("m")
j = C("j")
g = D("g")
e = E("e")
b = F("b")

c.w = m
c.o = e
c.t = b
c.p = b
c.x = b
c.q = g
m.y = b
m.s = e
m.x = e
m.t = j
m.r = g
j.z = c
j.p = g
j.y = g
j.o = e
g.x = e
e.s = j
e.v = c
e.w = c
e.z = g
b.w = m
b.t = m
assert m.x.z.x.s.z.txt == "c"