class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: A = None
        self.q: H = None
        self.u: F = None
        self.t: B = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: A = None
        self.o: C = None
        self.w: B = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.y: F = None
        self.t: B = None
        self.w: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: B = None
        self.w: F = None
        self.x: G = None
        self.u: F = None
        self.y: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: A = None
        self.q: H = None
        self.u: F = None
        self.t: B = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: A = None
        self.o: C = None
        self.w: B = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.y: F = None
        self.t: B = None
        self.w: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: B = None
        self.w: F = None
        self.x: G = None
        self.u: F = None
        self.y: D = None
        self.txt = txt

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

d.r = b
b.q = i
b.w = k
l.t = k
l.z = b
i.z = l
i.s = d
i.q = g
i.u = f
i.t = b
i.w = m
n.t = d
n.q = d
n.o = l
n.w = b
n.u = g
m.z = b
m.t = b
m.r = l
m.y = f
m.w = f
k.y = n
g.r = n
g.z = b
g.w = f
g.x = k
g.u = m
g.y = i
f.z = b
f.t = b
f.r = l
f.y = m
f.w = m
j.t = d
j.q = d
j.o = l
j.w = b
j.u = g
assert g.w.r.t.y.u.y.w.r.z.q.txt == "i"