class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: F = None
        self.o: G = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: E = None
        self.u: F = None
        self.w: B = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: H = None
        self.o: H = None
        self.p: E = None
        self.t: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: B = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: D = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

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

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

l.v = h
l.y = f
l.o = g
l.z = e
e.z = f
e.w = b
e.q = a
m.y = g
m.p = h
m.u = f
m.w = e
m.x = b
b.z = a
b.u = a
b.o = a
b.p = h
b.t = g
h.q = l
h.t = f
h.p = m
f.r = h
f.x = e
f.s = l
g.q = e
g.w = b
g.x = h
g.v = m
a.z = b
a.x = m
a.q = m
a.v = m
a.w = g
a.o = f
assert f.x.q.w.w.u.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: F = None
        self.o: G = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: E = None
        self.u: F = None
        self.w: B = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: H = None
        self.o: H = None
        self.p: E = None
        self.t: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: B = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: D = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

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

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

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