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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

g = A("g")
b = B("b")
l = C("l")
d = D("d")
f = E("f")
k = F("k")

g.q = k
g.o = l
g.w = l
g.y = d
g.p = b
b.w = l
b.z = l
b.x = g
b.p = g
b.u = g
b.y = d
l.u = d
d.s = g
f.v = k
k.o = b
k.u = d
k.v = f
k.w = g
assert l.u.s.o.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.y: D = None
        self.w: C = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

g = A("g")
b = B("b")
l = C("l")
d = D("d")
f = E("f")
k = F("k")

g.q = k
g.o = l
g.w = l
g.y = d
g.p = b
b.w = l
b.z = l
b.x = g
b.p = g
b.u = g
b.y = d
l.u = d
d.s = g
f.v = k
k.o = b
k.u = d
k.v = f
k.w = g
assert l.u.s.o.u.s.txt == "g"