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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: F = None
        self.v: G = None
        self.q: G = None
        self.w: H = None
        self.p: E = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: F = None
        self.v: G = None
        self.q: G = None
        self.w: H = None
        self.p: E = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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