class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: D = None
        self.u: D = None
        self.z: F = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: E = None
        self.r: A = None
        self.u: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: H = None
        self.u: E = None
        self.q: G = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: F = None
        self.txt = txt

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

g.s = j
g.t = d
g.u = d
g.z = i
g.r = b
f.x = b
f.t = k
a.y = f
a.p = k
a.r = g
a.u = j
d.q = j
d.x = j
d.u = a
n.y = k
n.u = k
n.t = j
n.q = b
n.w = d
i.t = k
i.s = d
i.w = a
i.x = n
b.y = j
j.y = g
j.z = i
h.x = b
h.t = k
k.y = n
k.u = n
k.t = j
k.q = b
k.w = d
assert g.u.u.r.z.x.q.y.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: D = None
        self.u: D = None
        self.z: F = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: E = None
        self.r: A = None
        self.u: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: H = None
        self.u: E = None
        self.q: G = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: F = None
        self.txt = txt

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

g.s = j
g.t = d
g.u = d
g.z = i
g.r = b
f.x = b
f.t = k
a.y = f
a.p = k
a.r = g
a.u = j
d.q = j
d.x = j
d.u = a
n.y = k
n.u = k
n.t = j
n.q = b
n.w = d
i.t = k
i.s = d
i.w = a
i.x = n
b.y = j
j.y = g
j.z = i
h.x = b
h.t = k
k.y = n
k.u = n
k.t = j
k.q = b
k.w = d
assert g.u.u.r.z.x.q.y.y.u.txt == "d"