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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.o: B = None
        self.txt = txt

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

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

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