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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: I = None
        self.u: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: D = None
        self.p: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: I = None
        self.x: A = None
        self.o: C = None
        self.v: A = None
        self.w: C = None
        self.u: I = None
        self.t: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: I = None
        self.u: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: D = None
        self.p: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: I = None
        self.x: A = None
        self.o: C = None
        self.v: A = None
        self.w: C = None
        self.u: I = None
        self.t: I = None
        self.txt = txt

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

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