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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: D = None
        self.txt = txt

e = A("e")
i = B("i")
b = C("b")
g = D("g")
m = E("m")
d = F("d")
a = G("a")
l = H("l")

e.q = l
e.t = a
e.r = b
i.z = g
i.p = a
b.u = g
b.y = g
b.p = l
g.v = i
g.s = m
m.r = l
d.r = g
d.o = i
d.w = i
d.q = b
a.v = m
a.z = m
a.o = g
a.q = g
l.w = a
l.p = g
assert m.r.p.v.p.z.r.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: G = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: D = None
        self.txt = txt

e = A("e")
i = B("i")
b = C("b")
g = D("g")
m = E("m")
d = F("d")
a = G("a")
l = H("l")

e.q = l
e.t = a
e.r = b
i.z = g
i.p = a
b.u = g
b.y = g
b.p = l
g.v = i
g.s = m
m.r = l
d.r = g
d.o = i
d.w = i
d.q = b
a.v = m
a.z = m
a.o = g
a.q = g
l.w = a
l.p = g
assert m.r.p.v.p.z.r.p.v.txt == "i"