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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: D = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: A = None
        self.q: E = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.u: D = None
        self.w: G = None
        self.t: F = None
        self.txt = txt

a = A("a")
i = B("i")
l = C("l")
b = D("b")
c = E("c")
m = F("m")
f = G("f")
n = E("n")
g = C("g")
j = G("j")

a.u = b
a.t = m
a.r = l
i.v = n
i.s = n
i.q = n
i.w = m
i.z = b
i.x = c
i.r = l
l.z = c
l.q = b
b.t = i
c.v = n
c.p = b
c.z = f
m.p = g
m.y = g
m.s = a
m.q = c
m.t = n
f.y = b
f.u = b
f.p = a
f.w = j
f.t = m
n.v = c
n.p = b
n.z = j
g.z = c
g.q = b
j.y = b
j.u = b
j.p = a
j.w = f
j.t = m
assert m.s.r.z.z.p.u.t.x.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: F = None
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: D = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: A = None
        self.q: E = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.u: D = None
        self.w: G = None
        self.t: F = None
        self.txt = txt

a = A("a")
i = B("i")
l = C("l")
b = D("b")
c = E("c")
m = F("m")
f = G("f")
n = E("n")
g = C("g")
j = G("j")

a.u = b
a.t = m
a.r = l
i.v = n
i.s = n
i.q = n
i.w = m
i.z = b
i.x = c
i.r = l
l.z = c
l.q = b
b.t = i
c.v = n
c.p = b
c.z = f
m.p = g
m.y = g
m.s = a
m.q = c
m.t = n
f.y = b
f.u = b
f.p = a
f.w = j
f.t = m
n.v = c
n.p = b
n.z = j
g.z = c
g.q = b
j.y = b
j.u = b
j.p = a
j.w = f
j.t = m
assert m.s.r.z.z.p.u.t.x.z.w.txt == "j"