class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: G = None
        self.y: D = None
        self.x: D = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: G = None
        self.z: C = None
        self.x: A = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: C = None
        self.q: G = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: G = None
        self.z: C = None
        self.x: A = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: C = None
        self.q: G = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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