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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: E = None
        self.z: F = None
        self.v: B = None
        self.y: B = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.s: D = None
        self.q: C = None
        self.w: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.txt = txt

a = A("a")
d = B("d")
j = C("j")
g = D("g")
l = E("l")
n = F("n")
f = E("f")

a.s = f
d.z = n
j.q = d
j.v = d
j.y = d
j.o = f
j.z = n
j.x = l
g.y = j
g.v = n
l.r = g
l.s = g
l.w = g
l.z = d
l.q = j
l.u = n
n.r = d
n.t = a
f.r = g
f.s = g
f.w = g
f.z = d
f.q = j
f.u = n
assert f.q.x.q.o.w.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: E = None
        self.z: F = None
        self.v: B = None
        self.y: B = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.s: D = None
        self.q: C = None
        self.w: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.txt = txt

a = A("a")
d = B("d")
j = C("j")
g = D("g")
l = E("l")
n = F("n")
f = E("f")

a.s = f
d.z = n
j.q = d
j.v = d
j.y = d
j.o = f
j.z = n
j.x = l
g.y = j
g.v = n
l.r = g
l.s = g
l.w = g
l.z = d
l.q = j
l.u = n
n.r = d
n.t = a
f.r = g
f.s = g
f.w = g
f.z = d
f.q = j
f.u = n
assert f.q.x.q.o.w.v.t.txt == "a"