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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: D = None
        self.v: A = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: D = None
        self.x: A = None
        self.o: G = None
        self.q: E = None
        self.s: A = None
        self.p: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

h.w = n
f.s = j
f.y = k
f.v = h
f.p = c
i.w = b
i.y = k
i.p = k
i.x = h
i.s = h
i.z = h
i.o = j
i.q = c
k.o = j
c.u = n
b.q = k
b.y = j
j.y = h
j.t = i
j.q = i
j.u = f
n.q = k
assert h.w.q.o.u.v.w.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: D = None
        self.v: A = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: D = None
        self.x: A = None
        self.o: G = None
        self.q: E = None
        self.s: A = None
        self.p: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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