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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: H = None
        self.r: D = None
        self.u: C = None
        self.t: F = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: H = None
        self.t: B = None
        self.q: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: H = None
        self.z: H = None
        self.u: A = None
        self.x: C = None
        self.r: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: E = None
        self.s: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: H = None
        self.r: D = None
        self.u: C = None
        self.t: F = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: H = None
        self.t: B = None
        self.q: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: H = None
        self.z: H = None
        self.u: A = None
        self.x: C = None
        self.r: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: E = None
        self.s: G = None
        self.txt = txt

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

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