class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: C = None
        self.v: C = None
        self.t: D = None
        self.q: E = None
        self.u: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.p: A = None
        self.x: H = None
        self.q: I = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: C = None
        self.z: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: G = None
        self.v: D = None
        self.t: E = None
        self.y: E = None
        self.q: G = None
        self.x: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: I = None
        self.u: C = None
        self.q: I = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.p: A = None
        self.x: H = None
        self.q: I = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: C = None
        self.z: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: G = None
        self.v: D = None
        self.t: E = None
        self.y: E = None
        self.q: G = None
        self.x: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: I = None
        self.u: C = None
        self.q: I = None
        self.txt = txt

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

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