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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: G = None
        self.r: B = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: G = None
        self.x: G = None
        self.t: G = None
        self.r: G = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: B = None
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

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

c = A("c")
e = B("e")
k = C("k")
b = D("b")
d = E("d")
l = F("l")
a = G("a")
f = H("f")
n = F("n")
m = B("m")

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: G = None
        self.r: B = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: G = None
        self.x: G = None
        self.t: G = None
        self.r: G = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: B = None
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

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

c = A("c")
e = B("e")
k = C("k")
b = D("b")
d = E("d")
l = F("l")
a = G("a")
f = H("f")
n = F("n")
m = B("m")

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