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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: A = None
        self.u: B = None
        self.p: D = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.txt = txt

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

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

e = A("e")
l = B("l")
d = C("d")
a = D("a")
k = E("k")
f = F("f")
j = E("j")
m = D("m")

e.x = d
e.p = k
e.v = k
l.s = f
l.y = e
d.v = m
d.o = e
d.u = l
d.p = a
d.x = f
a.s = l
a.v = k
k.o = e
k.z = l
f.p = d
f.r = d
f.q = d
f.z = l
j.o = e
j.z = l
m.s = l
m.v = j
assert m.s.y.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: E = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: A = None
        self.u: B = None
        self.p: D = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.txt = txt

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

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

e = A("e")
l = B("l")
d = C("d")
a = D("a")
k = E("k")
f = F("f")
j = E("j")
m = D("m")

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