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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.r: A = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.r: A = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

n.u = c
f.w = m
f.o = l
f.r = n
f.p = n
c.x = m
c.r = n
c.o = f
c.w = h
c.s = h
e.v = d
e.s = d
e.u = f
e.o = m
e.x = c
e.p = n
h.r = e
h.u = c
k.s = h
d.x = k
d.r = n
d.o = f
d.w = h
d.s = h
m.s = h
l.v = d
l.s = d
l.x = d
l.u = f
l.o = k
l.p = n
a.v = c
a.s = c
a.x = c
a.u = f
a.o = k
a.p = n
assert e.x.w.u.r.u.txt == "c"