class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: C = None
        self.o: B = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: A = None
        self.p: A = None
        self.u: C = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: A = None
        self.p: A = None
        self.u: C = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: C = None
        self.txt = txt

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

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

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