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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: A = None
        self.x: A = None
        self.u: A = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: C = None
        self.t: B = None
        self.z: C = None
        self.w: I = None
        self.p: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: A = None
        self.x: A = None
        self.u: A = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: C = None
        self.t: B = None
        self.z: C = None
        self.w: I = None
        self.p: H = None
        self.txt = txt

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

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