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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: B = None
        self.q: A = None
        self.x: D = None
        self.z: H = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: A = None
        self.x: H = None
        self.s: D = None
        self.u: H = None
        self.q: A = None
        self.w: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: D = None
        self.v: G = None
        self.q: B = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: D = None
        self.txt = txt

m = A("m")
i = B("i")
c = C("c")
j = D("j")
b = E("b")
l = F("l")
k = G("k")
e = H("e")
n = I("n")
g = E("g")

m.t = k
i.q = l
i.p = l
i.o = c
i.x = c
i.w = m
c.r = l
c.p = i
c.o = i
c.q = m
c.x = j
c.z = e
j.v = n
j.z = i
b.q = m
l.p = b
l.q = j
l.o = e
k.r = n
k.w = n
k.p = m
k.q = m
k.x = e
k.u = e
k.s = j
e.u = c
e.y = j
e.v = k
e.q = i
e.r = m
n.p = g
n.s = j
g.q = m
assert l.o.r.t.s.z.o.z.u.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: B = None
        self.q: A = None
        self.x: D = None
        self.z: H = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: A = None
        self.x: H = None
        self.s: D = None
        self.u: H = None
        self.q: A = None
        self.w: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: D = None
        self.v: G = None
        self.q: B = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: D = None
        self.txt = txt

m = A("m")
i = B("i")
c = C("c")
j = D("j")
b = E("b")
l = F("l")
k = G("k")
e = H("e")
n = I("n")
g = E("g")

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