class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: H = None
        self.x: E = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

l = A("l")
d = B("d")
f = C("f")
n = D("n")
e = E("e")
a = F("a")
h = G("h")
k = H("k")
b = B("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: H = None
        self.x: E = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

l = A("l")
d = B("d")
f = C("f")
n = D("n")
e = E("e")
a = F("a")
h = G("h")
k = H("k")
b = B("b")

l.x = k
d.z = n
d.w = f
d.p = l
d.v = e
d.y = a
f.p = a
n.w = a
n.q = a
n.t = k
n.x = e
n.p = d
e.r = l
e.v = l
e.y = h
e.u = h
e.p = n
e.q = k
a.w = l
a.t = k
a.q = f
a.u = f
a.s = f
a.v = d
h.r = k
h.w = a
h.x = n
k.y = l
k.q = f
k.z = n
k.r = n
k.v = h
b.z = n
b.w = f
b.p = l
b.v = e
b.y = a
assert h.w.q.p.q.p.t.z.p.w.txt == "f"