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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.v: D = None
        self.y: H = None
        self.q: D = None
        self.r: C = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.z: H = None
        self.p: E = None
        self.y: D = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.x: C = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.x: C = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.v: D = None
        self.y: H = None
        self.q: D = None
        self.r: C = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.z: H = None
        self.p: E = None
        self.y: D = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.x: C = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.x: C = None
        self.v: D = None
        self.txt = txt

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

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