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

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

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

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: F = None
        self.u: I = None
        self.v: I = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: F = None
        self.u: I = None
        self.v: I = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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