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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

f = A("f")
a = B("a")
h = C("h")
n = D("n")
c = E("c")
b = C("b")
i = C("i")
k = B("k")
g = D("g")

f.y = n
f.s = a
f.x = c
f.u = b
a.y = f
h.v = f
h.y = f
h.x = c
h.z = c
n.o = c
c.r = n
c.u = i
b.v = f
b.y = f
b.x = c
b.z = c
i.v = f
i.y = f
i.x = c
i.z = c
k.y = f
g.o = c
assert a.y.x.u.z.u.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: B = None
        self.x: E = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

f = A("f")
a = B("a")
h = C("h")
n = D("n")
c = E("c")
b = C("b")
i = C("i")
k = B("k")
g = D("g")

f.y = n
f.s = a
f.x = c
f.u = b
a.y = f
h.v = f
h.y = f
h.x = c
h.z = c
n.o = c
c.r = n
c.u = i
b.v = f
b.y = f
b.x = c
b.z = c
i.v = f
i.y = f
i.x = c
i.z = c
k.y = f
g.o = c
assert a.y.x.u.z.u.y.s.y.txt == "f"