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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: E = None
        self.q: D = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: E = None
        self.v: E = None
        self.s: G = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.x: D = None
        self.o: E = None
        self.v: A = None
        self.r: A = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: F = None
        self.s: E = None
        self.z: F = None
        self.p: F = None
        self.r: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: E = None
        self.q: D = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: E = None
        self.v: E = None
        self.s: G = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.x: D = None
        self.o: E = None
        self.v: A = None
        self.r: A = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: F = None
        self.s: E = None
        self.z: F = None
        self.p: F = None
        self.r: G = None
        self.txt = txt

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

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