class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: G = None
        self.v: D = None
        self.w: E = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.z: G = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: G = None
        self.u: F = None
        self.x: C = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.z: B = None
        self.v: C = None
        self.txt = txt

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

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

c.q = i
c.z = f
c.v = n
c.w = d
c.y = b
g.z = n
g.v = f
g.r = i
j.q = c
j.p = c
j.z = f
j.s = i
n.q = c
n.t = f
n.u = b
n.x = j
n.o = g
d.p = g
d.o = i
d.q = c
b.z = g
b.q = l
b.t = c
b.p = c
b.y = j
f.p = j
f.v = j
f.s = n
f.z = g
i.u = c
i.s = j
l.p = g
l.o = i
l.q = c
assert d.o.u.w.o.u.q.s.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: G = None
        self.v: D = None
        self.w: E = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.z: G = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: G = None
        self.u: F = None
        self.x: C = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.z: B = None
        self.v: C = None
        self.txt = txt

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

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

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