class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: G = None
        self.x: F = None
        self.v: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: H = None
        self.q: C = None
        self.o: D = None
        self.v: E = None
        self.x: E = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.q: A = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: G = None
        self.t: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: H = None
        self.q: C = None
        self.o: D = None
        self.v: E = None
        self.x: E = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.q: A = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: G = None
        self.t: F = None
        self.w: A = None
        self.txt = txt

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

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