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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: D = None
        self.txt = txt

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

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

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

d = A("d")
f = B("f")
e = C("e")
c = D("c")
n = E("n")
l = A("l")

d.y = f
d.r = c
d.x = c
f.t = n
f.y = c
e.r = c
e.t = n
e.v = d
c.x = l
c.y = e
c.u = d
n.x = f
n.u = f
n.o = d
l.y = f
l.r = c
l.x = c
assert e.v.r.y.r.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: D = None
        self.txt = txt

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

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

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

d = A("d")
f = B("f")
e = C("e")
c = D("c")
n = E("n")
l = A("l")

d.y = f
d.r = c
d.x = c
f.t = n
f.y = c
e.r = c
e.t = n
e.v = d
c.x = l
c.y = e
c.u = d
n.x = f
n.u = f
n.o = d
l.y = f
l.r = c
l.x = c
assert e.v.r.y.r.u.y.txt == "f"