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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: C = None
        self.s: A = None
        self.t: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: D = None
        self.s: B = None
        self.q: A = None
        self.w: E = None
        self.o: D = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: C = None
        self.s: A = None
        self.t: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: D = None
        self.s: B = None
        self.q: A = None
        self.w: E = None
        self.o: D = None
        self.t: F = None
        self.txt = txt

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

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