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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.q: G = None
        self.w: I = None
        self.s: D = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: B = None
        self.s: I = None
        self.t: H = None
        self.u: A = None
        self.y: J = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: J = None
        self.q: A = None
        self.y: B = None
        self.o: J = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.q: G = None
        self.w: I = None
        self.s: D = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: B = None
        self.s: I = None
        self.t: H = None
        self.u: A = None
        self.y: J = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: J = None
        self.q: A = None
        self.y: B = None
        self.o: J = None
        self.r: F = None
        self.txt = txt

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

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

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

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