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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: A = None
        self.p: G = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

f = A("f")
k = B("k")
g = C("g")
m = D("m")
e = E("e")
n = F("n")
j = G("j")
d = H("d")

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: A = None
        self.p: G = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

f = A("f")
k = B("k")
g = C("g")
m = D("m")
e = E("e")
n = F("n")
j = G("j")
d = H("d")

f.o = g
k.p = e
k.t = m
g.v = k
g.q = k
g.x = m
g.s = m
g.o = n
g.w = j
g.r = j
g.p = d
m.s = g
m.v = g
m.q = f
m.p = f
m.o = e
m.r = e
m.x = e
e.o = m
e.p = k
n.q = d
n.z = f
n.p = j
n.x = g
j.y = d
d.t = k
d.o = k
d.z = g
d.u = g
d.p = e
d.s = j
d.w = m
d.x = n
assert j.y.x.z.o.o.p.y.txt == "d"