class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: A = None
        self.r: A = None
        self.y: B = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: C = None
        self.v: H = None
        self.o: F = None
        self.q: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: C = None
        self.v: H = None
        self.o: F = None
        self.q: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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