class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: B = None
        self.q: B = None
        self.r: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: A = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: B = None
        self.q: B = None
        self.r: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: A = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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