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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: B = None
        self.t: E = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: B = None
        self.t: E = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

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