class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: F = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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