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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: D = None
        self.z: A = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: A = None
        self.u: A = None
        self.o: A = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: D = None
        self.y: B = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: D = None
        self.p: H = None
        self.s: G = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: D = None
        self.z: A = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: A = None
        self.u: A = None
        self.o: A = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: D = None
        self.y: B = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: D = None
        self.p: H = None
        self.s: G = None
        self.z: A = None
        self.txt = txt

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

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