class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: E = None
        self.x: E = None
        self.s: J = None
        self.r: J = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: A = None
        self.w: F = None
        self.x: E = None
        self.y: I = None
        self.r: I = None
        self.o: J = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: I = None
        self.p: J = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: A = None
        self.w: F = None
        self.x: E = None
        self.y: I = None
        self.r: I = None
        self.o: J = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: I = None
        self.p: J = None
        self.txt = txt

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

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

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

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

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

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