class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: A = None
        self.v: H = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: B = None
        self.s: C = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: B = None
        self.o: G = None
        self.q: G = None
        self.v: G = None
        self.txt = txt

l = A("l")
i = B("i")
n = C("n")
k = D("k")
b = E("b")
j = F("j")
f = G("f")
e = H("e")
a = G("a")
c = A("c")

l.q = n
i.y = c
i.p = e
n.s = b
n.w = j
k.z = e
k.x = j
b.p = n
b.t = l
b.u = j
j.p = n
j.r = n
j.q = l
j.v = e
j.o = k
f.r = e
f.t = i
f.s = n
f.u = k
e.y = f
e.q = f
e.v = f
e.r = i
e.o = a
a.r = e
a.t = i
a.s = n
a.u = k
c.q = n
assert f.u.x.q.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: A = None
        self.v: H = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: B = None
        self.s: C = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: B = None
        self.o: G = None
        self.q: G = None
        self.v: G = None
        self.txt = txt

l = A("l")
i = B("i")
n = C("n")
k = D("k")
b = E("b")
j = F("j")
f = G("f")
e = H("e")
a = G("a")
c = A("c")

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