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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: B = None
        self.s: D = None
        self.q: C = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: G = None
        self.w: A = None
        self.y: E = None
        self.t: H = None
        self.x: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: B = None
        self.s: D = None
        self.q: C = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: G = None
        self.w: A = None
        self.y: E = None
        self.t: H = None
        self.x: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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