class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: G = None
        self.r: F = None
        self.o: E = None
        self.s: C = None
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: A = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: G = None
        self.q: G = None
        self.txt = txt

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

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

i = A("i")
h = B("h")
f = C("f")
l = D("l")
j = E("j")
g = F("g")
m = G("m")
a = E("a")
d = G("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: A = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: G = None
        self.q: G = None
        self.txt = txt

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

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

i = A("i")
h = B("h")
f = C("f")
l = D("l")
j = E("j")
g = F("g")
m = G("m")
a = E("a")
d = G("d")

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