class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: C = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.v: F = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: F = None
        self.u: I = None
        self.z: C = None
        self.o: A = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: D = None
        self.t: F = None
        self.v: F = None
        self.w: E = None
        self.s: E = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: B = None
        self.q: F = None
        self.v: G = None
        self.t: H = None
        self.y: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.v: F = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: F = None
        self.u: I = None
        self.z: C = None
        self.o: A = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: D = None
        self.t: F = None
        self.v: F = None
        self.w: E = None
        self.s: E = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: B = None
        self.q: F = None
        self.v: G = None
        self.t: H = None
        self.y: H = None
        self.txt = txt

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

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