class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: A = None
        self.u: F = None
        self.q: G = None
        self.y: H = None
        self.z: A = None
        self.o: H = None
        self.v: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: A = None
        self.s: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: A = None
        self.u: F = None
        self.q: G = None
        self.y: H = None
        self.z: A = None
        self.o: H = None
        self.v: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: A = None
        self.s: D = None
        self.txt = txt

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

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