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

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

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

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

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

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

m = A("m")
k = B("k")
j = C("j")
d = D("d")
f = E("f")
c = F("c")

m.v = c
m.r = c
m.z = f
m.p = d
m.o = d
k.q = c
k.o = m
k.z = d
j.z = f
j.q = m
d.x = m
d.s = j
d.v = j
d.r = f
f.y = m
f.q = m
f.p = j
f.o = c
f.v = k
c.z = f
c.v = f
assert j.z.v.o.p.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: F = None
        self.z: E = None
        self.p: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

m = A("m")
k = B("k")
j = C("j")
d = D("d")
f = E("f")
c = F("c")

m.v = c
m.r = c
m.z = f
m.p = d
m.o = d
k.q = c
k.o = m
k.z = d
j.z = f
j.q = m
d.x = m
d.s = j
d.v = j
d.r = f
f.y = m
f.q = m
f.p = j
f.o = c
f.v = k
c.z = f
c.v = f
assert j.z.v.o.p.s.z.txt == "f"