class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: B = None
        self.y: B = None
        self.q: G = None
        self.p: E = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: G = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: F = None
        self.o: H = None
        self.v: D = None
        self.y: D = None
        self.x: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: B = None
        self.y: B = None
        self.q: G = None
        self.p: E = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: G = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: F = None
        self.o: H = None
        self.v: D = None
        self.y: D = None
        self.x: F = None
        self.txt = txt

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

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