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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: E = None
        self.q: C = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: E = None
        self.q: C = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

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

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

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

l.w = k
l.o = e
l.z = g
l.p = g
g.v = e
j.q = g
j.v = g
j.p = k
j.u = l
j.z = l
j.x = e
k.t = g
k.w = e
k.v = e
k.u = e
k.q = j
e.x = g
e.q = j
a.p = j
a.s = g
assert a.p.q.v.x.v.q.txt == "j"