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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: F = None
        self.x: E = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: F = None
        self.x: E = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

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

l.w = b
h.v = i
h.z = l
h.w = b
n.y = i
n.o = g
n.t = g
n.q = g
n.z = j
n.r = b
b.t = j
j.w = i
j.z = h
g.r = c
c.s = i
c.y = g
c.x = j
c.r = k
c.t = l
i.y = b
i.t = n
i.w = g
k.w = b
assert k.w.t.z.z.w.txt == "b"