class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: D = None
        self.z: E = None
        self.t: E = None
        self.q: C = None
        self.v: C = None
        self.u: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: A = None
        self.txt = txt

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

a.o = k
l.s = n
l.q = i
l.u = f
l.y = e
d.x = k
d.y = e
d.z = m
d.t = m
d.q = n
d.v = n
d.u = i
e.q = n
e.u = n
e.o = a
m.t = a
m.v = n
i.s = n
i.z = a
k.v = i
k.x = a
f.o = k
n.x = k
n.y = e
n.z = m
n.t = m
n.q = d
n.v = d
n.u = i
assert m.t.o.v.z.o.x.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: D = None
        self.z: E = None
        self.t: E = None
        self.q: C = None
        self.v: C = None
        self.u: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: A = None
        self.txt = txt

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

a.o = k
l.s = n
l.q = i
l.u = f
l.y = e
d.x = k
d.y = e
d.z = m
d.t = m
d.q = n
d.v = n
d.u = i
e.q = n
e.u = n
e.o = a
m.t = a
m.v = n
i.s = n
i.z = a
k.v = i
k.x = a
f.o = k
n.x = k
n.y = e
n.z = m
n.t = m
n.q = d
n.v = d
n.u = i
assert m.t.o.v.z.o.x.o.v.txt == "i"