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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.txt = txt

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

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

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

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

i = A("i")
h = B("h")
n = C("n")
c = D("c")
d = E("d")
l = F("l")
k = F("k")
g = B("g")
a = C("a")
m = D("m")

i.r = l
h.v = c
h.x = i
n.s = k
n.w = i
n.u = a
n.x = a
c.z = m
c.y = l
c.s = l
d.y = g
d.u = g
d.w = c
d.v = n
d.x = l
l.w = k
l.v = m
l.y = d
l.s = d
k.w = l
k.v = m
k.y = d
k.s = d
g.v = m
g.x = i
a.s = k
a.w = i
a.u = n
a.x = n
m.z = c
m.y = k
m.s = l
assert n.s.y.v.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.txt = txt

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

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

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

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

i = A("i")
h = B("h")
n = C("n")
c = D("c")
d = E("d")
l = F("l")
k = F("k")
g = B("g")
a = C("a")
m = D("m")

i.r = l
h.v = c
h.x = i
n.s = k
n.w = i
n.u = a
n.x = a
c.z = m
c.y = l
c.s = l
d.y = g
d.u = g
d.w = c
d.v = n
d.x = l
l.w = k
l.v = m
l.y = d
l.s = d
k.w = l
k.v = m
k.y = d
k.s = d
g.v = m
g.x = i
a.s = k
a.w = i
a.u = n
a.x = n
m.z = c
m.y = k
m.s = l
assert n.s.y.v.u.x.txt == "n"