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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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