class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: D = None
        self.v: B = None
        self.x: G = None
        self.t: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: J = None
        self.o: I = None
        self.q: B = None
        self.t: D = None
        self.y: E = None
        self.z: J = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: H = None
        self.z: B = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: C = None
        self.r: D = None
        self.u: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: J = None
        self.v: J = None
        self.q: A = None
        self.w: I = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: E = None
        self.x: B = None
        self.u: E = None
        self.r: A = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: J = None
        self.o: I = None
        self.q: B = None
        self.t: D = None
        self.y: E = None
        self.z: J = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: H = None
        self.z: B = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: C = None
        self.r: D = None
        self.u: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: J = None
        self.v: J = None
        self.q: A = None
        self.w: I = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: E = None
        self.x: B = None
        self.u: E = None
        self.r: A = None
        self.y: E = None
        self.txt = txt

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

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

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