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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: B = None
        self.u: B = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.v: A = None
        self.o: C = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: A = None
        self.w: E = None
        self.txt = txt

m = A("m")
a = B("a")
e = C("e")
l = D("l")
f = E("f")
c = F("c")

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: B = None
        self.u: B = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.v: A = None
        self.o: C = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: A = None
        self.w: E = None
        self.txt = txt

m = A("m")
a = B("a")
e = C("e")
l = D("l")
f = E("f")
c = F("c")

m.o = l
m.w = f
m.y = a
m.z = a
m.x = c
m.v = c
a.w = m
a.q = m
a.p = m
a.o = m
a.x = l
a.y = c
e.r = c
e.y = c
e.o = a
e.u = a
l.p = e
l.z = c
f.r = a
f.p = m
f.v = m
f.o = e
f.s = c
c.p = a
c.u = m
c.w = f
assert m.o.z.p.x.p.o.txt == "a"