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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.z: C = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: H = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: G = None
        self.q: D = None
        self.x: D = None
        self.z: D = None
        self.r: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.z: C = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: H = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: G = None
        self.q: D = None
        self.x: D = None
        self.z: D = None
        self.r: H = None
        self.txt = txt

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

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