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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.o: E = None
        self.s: E = None
        self.q: H = None
        self.y: E = None
        self.p: H = None
        self.w: G = None
        self.t: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: A = None
        self.w: J = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: J = None
        self.u: E = None
        self.o: J = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: J = None
        self.r: C = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: F = None
        self.z: B = None
        self.y: D = None
        self.t: J = None
        self.p: H = None
        self.v: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: E = None
        self.t: C = None
        self.r: H = None
        self.txt = txt

h = A("h")
c = B("c")
b = C("b")
f = D("f")
d = E("d")
n = F("n")
a = G("a")
l = H("l")
g = I("g")
k = J("k")

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.o: E = None
        self.s: E = None
        self.q: H = None
        self.y: E = None
        self.p: H = None
        self.w: G = None
        self.t: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: A = None
        self.w: J = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: J = None
        self.u: E = None
        self.o: J = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: J = None
        self.r: C = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: F = None
        self.z: B = None
        self.y: D = None
        self.t: J = None
        self.p: H = None
        self.v: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: E = None
        self.t: C = None
        self.r: H = None
        self.txt = txt

h = A("h")
c = B("c")
b = C("b")
f = D("f")
d = E("d")
n = F("n")
a = G("a")
l = H("l")
g = I("g")
k = J("k")

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