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

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

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

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

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

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

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

a.q = e
l.v = m
l.t = m
l.q = j
l.o = a
e.u = j
e.t = j
e.s = j
e.v = l
e.y = l
e.p = a
m.v = k
m.o = k
j.o = l
k.w = e
k.o = l
k.p = l
assert j.o.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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