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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: B = None
        self.p: H = None
        self.v: H = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.w: F = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.y: A = None
        self.z: B = None
        self.r: B = None
        self.x: E = None
        self.t: C = None
        self.v: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: D = None
        self.y: D = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

l = A("l")
b = B("b")
i = C("i")
c = D("c")
m = E("m")
a = F("a")
d = G("d")
n = H("n")

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: B = None
        self.p: H = None
        self.v: H = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.w: F = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.y: A = None
        self.z: B = None
        self.r: B = None
        self.x: E = None
        self.t: C = None
        self.v: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: D = None
        self.y: D = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

l = A("l")
b = B("b")
i = C("i")
c = D("c")
m = E("m")
a = F("a")
d = G("d")
n = H("n")

l.q = n
l.w = b
b.p = i
b.x = i
b.u = i
b.s = m
b.v = l
b.y = l
i.s = m
i.r = b
i.p = n
i.v = n
i.t = a
c.q = d
m.u = b
m.o = b
m.v = d
m.w = a
a.q = l
a.y = l
a.u = c
a.z = b
a.r = b
a.x = m
a.t = i
a.v = i
d.w = b
d.x = i
n.p = i
n.u = i
n.o = c
n.y = c
n.z = b
assert a.r.s.u.u.r.y.q.u.txt == "i"