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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: B = None
        self.u: E = None
        self.q: H = None
        self.y: D = None
        self.w: D = None
        self.txt = txt

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

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

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

l.y = n
j.v = n
g.x = i
g.v = i
g.t = h
g.y = h
h.u = k
n.w = j
n.s = j
i.x = l
i.s = j
i.u = n
i.q = k
i.y = h
i.w = h
a.w = j
a.y = k
k.x = j
assert j.v.w.v.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: B = None
        self.u: E = None
        self.q: H = None
        self.y: D = None
        self.w: D = None
        self.txt = txt

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

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

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

l.y = n
j.v = n
g.x = i
g.v = i
g.t = h
g.y = h
h.u = k
n.w = j
n.s = j
i.x = l
i.s = j
i.u = n
i.q = k
i.y = h
i.w = h
a.w = j
a.y = k
k.x = j
assert j.v.w.v.s.v.txt == "n"