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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.r: C = None
        self.z: E = None
        self.t: C = None
        self.y: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.r: C = None
        self.z: E = None
        self.t: C = None
        self.y: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

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

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