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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: H = None
        self.s: E = None
        self.z: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: D = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: C = None
        self.q: F = None
        self.r: A = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: E = None
        self.w: F = None
        self.o: E = None
        self.u: F = None
        self.s: A = None
        self.z: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: H = None
        self.s: E = None
        self.z: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: D = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: C = None
        self.q: F = None
        self.r: A = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: E = None
        self.w: F = None
        self.o: E = None
        self.u: F = None
        self.s: A = None
        self.z: A = None
        self.txt = txt

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

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