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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: G = None
        self.z: F = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.z: G = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: G = None
        self.txt = txt

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

h = A("h")
i = B("i")
b = C("b")
j = D("j")
n = E("n")
g = F("g")
c = G("c")
f = G("f")
m = B("m")

h.v = g
i.w = n
b.s = f
b.t = f
b.q = c
b.z = g
j.x = n
j.r = b
j.z = f
j.s = f
n.r = i
g.t = i
g.x = f
c.r = g
f.r = g
m.w = n
assert n.r.w.r.w.r.w.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: G = None
        self.z: F = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.z: G = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: G = None
        self.txt = txt

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

h = A("h")
i = B("i")
b = C("b")
j = D("j")
n = E("n")
g = F("g")
c = G("c")
f = G("f")
m = B("m")

h.v = g
i.w = n
b.s = f
b.t = f
b.q = c
b.z = g
j.x = n
j.r = b
j.z = f
j.s = f
n.r = i
g.t = i
g.x = f
c.r = g
f.r = g
m.w = n
assert n.r.w.r.w.r.w.r.w.txt == "n"