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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

e = A("e")
a = B("a")
g = C("g")
c = D("c")
b = E("b")
l = F("l")

e.q = l
a.o = l
a.w = g
g.o = l
g.p = c
c.x = b
b.z = c
b.p = c
b.s = e
b.v = e
b.x = l
b.r = l
l.y = b
assert b.x.y.z.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

e = A("e")
a = B("a")
g = C("g")
c = D("c")
b = E("b")
l = F("l")

e.q = l
a.o = l
a.w = g
g.o = l
g.p = c
c.x = b
b.z = c
b.p = c
b.s = e
b.v = e
b.x = l
b.r = l
l.y = b
assert b.x.y.z.x.x.txt == "l"