class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: J = None
        self.q: J = None
        self.t: E = None
        self.s: I = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.o: A = None
        self.p: G = None
        self.z: A = None
        self.s: J = None
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: H = None
        self.v: E = None
        self.q: J = None
        self.z: E = None
        self.o: B = None
        self.w: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: B = None
        self.z: H = None
        self.t: E = None
        self.q: A = None
        self.v: J = None
        self.s: B = None
        self.y: J = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: G = None
        self.q: D = None
        self.y: F = None
        self.p: C = None
        self.s: J = None
        self.r: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.o: A = None
        self.p: G = None
        self.z: A = None
        self.s: J = None
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: H = None
        self.v: E = None
        self.q: J = None
        self.z: E = None
        self.o: B = None
        self.w: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: B = None
        self.z: H = None
        self.t: E = None
        self.q: A = None
        self.v: J = None
        self.s: B = None
        self.y: J = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: G = None
        self.q: D = None
        self.y: F = None
        self.p: C = None
        self.s: J = None
        self.r: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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