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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: E = None
        self.w: C = None
        self.t: C = None
        self.y: E = None
        self.v: F = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
m = C("m")
f = D("f")
i = E("i")
l = F("l")
b = A("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: E = None
        self.w: C = None
        self.t: C = None
        self.y: E = None
        self.v: F = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
m = C("m")
f = D("f")
i = E("i")
l = F("l")
b = A("b")

k.o = b
k.r = m
a.s = f
m.v = b
f.p = a
f.z = i
f.y = i
f.w = m
f.t = m
f.v = l
i.q = b
i.w = m
i.s = a
l.s = i
l.v = m
l.x = b
l.u = f
b.o = k
b.r = m
assert l.s.w.v.o.r.v.txt == "b"