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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: H = None
        self.x: B = None
        self.y: F = None
        self.t: G = None
        self.r: F = None
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: H = None
        self.x: B = None
        self.y: F = None
        self.t: G = None
        self.r: F = None
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.s: C = None
        self.txt = txt

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

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

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