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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: D = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: C = None
        self.v: A = None
        self.u: E = None
        self.s: D = None
        self.txt = txt

f = A("f")
b = B("b")
d = C("d")
k = D("k")
h = E("h")
l = D("l")
m = E("m")
n = B("n")

f.u = h
f.x = d
f.p = l
b.r = d
b.v = h
b.z = n
b.x = l
d.y = k
d.w = l
d.q = f
k.u = m
k.q = d
h.t = l
h.s = l
h.q = d
h.v = f
h.u = m
l.u = m
l.q = d
m.t = k
m.s = k
m.q = d
m.v = f
m.u = h
n.r = d
n.v = m
n.z = b
n.x = l
assert m.v.p.u.s.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: C = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: D = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: C = None
        self.v: A = None
        self.u: E = None
        self.s: D = None
        self.txt = txt

f = A("f")
b = B("b")
d = C("d")
k = D("k")
h = E("h")
l = D("l")
m = E("m")
n = B("n")

f.u = h
f.x = d
f.p = l
b.r = d
b.v = h
b.z = n
b.x = l
d.y = k
d.w = l
d.q = f
k.u = m
k.q = d
h.t = l
h.s = l
h.q = d
h.v = f
h.u = m
l.u = m
l.q = d
m.t = k
m.s = k
m.q = d
m.v = f
m.u = h
n.r = d
n.v = m
n.z = b
n.x = l
assert m.v.p.u.s.q.y.txt == "k"