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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: E = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.x: C = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.t: D = None
        self.x: F = None
        self.q: C = None
        self.r: D = None
        self.txt = txt

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

m = A("m")
e = B("e")
b = C("b")
d = D("d")
k = E("k")
c = F("c")

m.x = b
e.v = k
e.o = m
b.p = k
b.y = k
b.w = m
b.s = e
d.o = k
d.q = k
d.u = m
d.x = b
d.y = c
k.v = b
k.z = b
k.q = b
k.t = d
k.r = d
k.x = c
c.x = k
assert e.v.r.q.q.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: E = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.x: C = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.t: D = None
        self.x: F = None
        self.q: C = None
        self.r: D = None
        self.txt = txt

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

m = A("m")
e = B("e")
b = C("b")
d = D("d")
k = E("k")
c = F("c")

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