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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: F = None
        self.x: H = None
        self.o: F = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: E = None
        self.v: G = None
        self.r: B = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: F = None
        self.x: D = None
        self.y: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: F = None
        self.x: H = None
        self.o: F = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: E = None
        self.v: G = None
        self.r: B = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: F = None
        self.x: D = None
        self.y: H = None
        self.txt = txt

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

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