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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: H = None
        self.r: I = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: B = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: G = None
        self.t: I = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.o: A = None
        self.r: B = None
        self.w: A = None
        self.y: B = None
        self.z: D = None
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: H = None
        self.r: I = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: B = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: G = None
        self.t: I = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.o: A = None
        self.r: B = None
        self.w: A = None
        self.y: B = None
        self.z: D = None
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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