class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.o: A = None
        self.y: D = None
        self.s: C = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: B = None
        self.o: E = None
        self.t: E = None
        self.r: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.o: A = None
        self.y: D = None
        self.s: C = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: B = None
        self.o: E = None
        self.t: E = None
        self.r: A = None
        self.txt = txt

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

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