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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: B = None
        self.v: G = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: B = None
        self.v: G = None
        self.r: E = None
        self.txt = txt

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

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

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

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