class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: H = None
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: H = None
        self.s: G = None
        self.y: H = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: H = None
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: H = None
        self.s: G = None
        self.y: H = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

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

f.u = m
f.q = n
n.w = m
b.v = n
b.r = m
a.s = n
a.w = n
a.z = e
a.r = b
d.r = f
d.t = m
d.p = i
e.q = a
e.y = n
e.s = f
g.x = d
g.v = m
g.y = m
g.s = j
g.w = n
g.u = n
m.y = b
m.p = e
m.w = d
m.z = n
i.v = n
i.r = m
j.x = d
j.v = m
j.y = m
j.s = g
j.w = n
j.u = n
assert d.t.z.w.w.r.q.w.w.p.txt == "i"