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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: G = None
        self.o: C = None
        self.x: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: B = None
        self.o: A = None
        self.v: C = None
        self.p: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: D = None
        self.o: H = None
        self.txt = txt

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

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

a.o = n
a.x = g
a.z = h
j.u = c
j.o = c
j.z = e
j.x = e
c.p = e
c.v = n
c.q = d
c.x = d
c.s = j
c.w = m
d.v = b
d.x = e
h.z = d
h.s = j
h.o = b
h.v = c
h.p = m
n.x = m
n.z = g
e.w = g
e.o = g
e.u = d
g.o = h
g.u = d
m.z = d
m.s = j
m.o = b
m.v = c
m.p = h
b.o = n
b.x = g
b.z = m
assert n.z.o.p.p.v.p.o.o.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: H = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: G = None
        self.o: C = None
        self.x: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: B = None
        self.o: A = None
        self.v: C = None
        self.p: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: D = None
        self.o: H = None
        self.txt = txt

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

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

a.o = n
a.x = g
a.z = h
j.u = c
j.o = c
j.z = e
j.x = e
c.p = e
c.v = n
c.q = d
c.x = d
c.s = j
c.w = m
d.v = b
d.x = e
h.z = d
h.s = j
h.o = b
h.v = c
h.p = m
n.x = m
n.z = g
e.w = g
e.o = g
e.u = d
g.o = h
g.u = d
m.z = d
m.s = j
m.o = b
m.v = c
m.p = h
b.o = n
b.x = g
b.z = m
assert n.z.o.p.p.v.p.o.o.v.x.txt == "d"