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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: A = None
        self.x: C = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.u: A = None
        self.z: C = None
        self.txt = txt

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

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

e = A("e")
a = B("a")
c = C("c")
n = D("n")
g = E("g")
k = F("k")
m = G("m")
l = H("l")

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: A = None
        self.x: C = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.u: A = None
        self.z: C = None
        self.txt = txt

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

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

e = A("e")
a = B("a")
c = C("c")
n = D("n")
g = E("g")
k = F("k")
m = G("m")
l = H("l")

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