class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: G = None
        self.o: E = None
        self.y: G = None
        self.u: E = None
        self.q: E = None
        self.v: H = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: E = None
        self.v: D = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: I = None
        self.z: E = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: G = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: I = None
        self.o: D = None
        self.p: H = None
        self.s: D = None
        self.v: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.t: A = None
        self.s: C = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: E = None
        self.v: D = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: I = None
        self.z: E = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: G = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: I = None
        self.o: D = None
        self.p: H = None
        self.s: D = None
        self.v: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.t: A = None
        self.s: C = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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