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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: E = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.u: A = None
        self.y: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: H = None
        self.t: G = None
        self.y: C = None
        self.z: C = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: A = None
        self.z: D = None
        self.t: A = None
        self.q: A = None
        self.x: F = None
        self.y: D = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: E = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.u: A = None
        self.y: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: H = None
        self.t: G = None
        self.y: C = None
        self.z: C = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: A = None
        self.z: D = None
        self.t: A = None
        self.q: A = None
        self.x: F = None
        self.y: D = None
        self.w: F = None
        self.txt = txt

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

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