class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.t: J = None
        self.u: F = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: J = None
        self.v: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: A = None
        self.p: A = None
        self.o: B = None
        self.q: H = None
        self.u: I = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.o: D = None
        self.u: I = None
        self.t: F = None
        self.s: F = None
        self.z: A = None
        self.x: C = None
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: F = None
        self.q: C = None
        self.t: C = None
        self.s: G = None
        self.x: B = None
        self.o: D = None
        self.p: H = None
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: J = None
        self.v: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: A = None
        self.p: A = None
        self.o: B = None
        self.q: H = None
        self.u: I = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.o: D = None
        self.u: I = None
        self.t: F = None
        self.s: F = None
        self.z: A = None
        self.x: C = None
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: F = None
        self.q: C = None
        self.t: C = None
        self.s: G = None
        self.x: B = None
        self.o: D = None
        self.p: H = None
        self.w: D = None
        self.txt = txt

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

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