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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: D = None
        self.r: F = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: C = None
        self.t: E = None
        self.r: A = None
        self.u: F = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: E = None
        self.w: E = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: D = None
        self.x: D = None
        self.u: G = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: D = None
        self.r: F = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: C = None
        self.t: E = None
        self.r: A = None
        self.u: F = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: E = None
        self.w: E = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: D = None
        self.x: D = None
        self.u: G = None
        self.q: D = None
        self.txt = txt

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

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