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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.v: G = None
        self.u: D = None
        self.o: C = None
        self.y: H = None
        self.s: F = None
        self.z: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: A = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: D = None
        self.q: F = None
        self.w: F = None
        self.o: G = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: H = None
        self.t: A = None
        self.p: E = None
        self.v: H = None
        self.w: B = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.v: G = None
        self.u: D = None
        self.o: C = None
        self.y: H = None
        self.s: F = None
        self.z: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: A = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: D = None
        self.q: F = None
        self.w: F = None
        self.o: G = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: H = None
        self.t: A = None
        self.p: E = None
        self.v: H = None
        self.w: B = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: C = None
        self.txt = txt

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

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