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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: C = None
        self.x: A = None
        self.r: A = None
        self.y: D = None
        self.v: H = None
        self.s: D = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: G = None
        self.s: H = None
        self.q: B = None
        self.r: H = None
        self.y: G = None
        self.txt = txt

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

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

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

a = A("a")
h = B("h")
j = C("j")
k = D("k")
b = E("b")
i = F("i")
d = G("d")
e = H("e")
g = H("g")

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: C = None
        self.x: A = None
        self.r: A = None
        self.y: D = None
        self.v: H = None
        self.s: D = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: G = None
        self.s: H = None
        self.q: B = None
        self.r: H = None
        self.y: G = None
        self.txt = txt

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

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

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

a = A("a")
h = B("h")
j = C("j")
k = D("k")
b = E("b")
i = F("i")
d = G("d")
e = H("e")
g = H("g")

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