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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: C = None
        self.y: F = None
        self.v: A = None
        self.u: C = None
        self.p: F = None
        self.txt = txt

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

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

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

a.x = n
a.q = g
a.u = i
l.z = n
n.p = a
m.s = f
m.r = n
m.u = n
m.y = e
m.p = e
m.v = a
i.q = n
i.p = f
i.r = l
e.s = f
e.u = n
f.s = m
f.r = n
f.u = n
f.y = e
f.p = e
f.v = g
d.z = n
g.x = n
g.q = a
g.u = i
assert i.p.s.s.s.v.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: C = None
        self.y: F = None
        self.v: A = None
        self.u: C = None
        self.p: F = None
        self.txt = txt

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

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

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

a.x = n
a.q = g
a.u = i
l.z = n
n.p = a
m.s = f
m.r = n
m.u = n
m.y = e
m.p = e
m.v = a
i.q = n
i.p = f
i.r = l
e.s = f
e.u = n
f.s = m
f.r = n
f.u = n
f.y = e
f.p = e
f.v = g
d.z = n
g.x = n
g.q = a
g.u = i
assert i.p.s.s.s.v.q.x.txt == "n"