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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.v: C = None
        self.q: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.q: B = None
        self.s: E = None
        self.txt = txt

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

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

d = A("d")
h = B("h")
f = C("f")
k = D("k")
l = E("l")
g = B("g")

d.u = g
d.y = l
d.o = k
h.y = l
h.p = l
h.v = f
h.q = g
f.r = l
f.v = l
f.s = l
f.q = h
k.u = l
k.x = d
k.v = d
l.x = d
l.v = f
l.z = f
g.y = l
g.p = l
g.v = f
g.q = h
assert d.y.x.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: E = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.v: C = None
        self.q: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.q: B = None
        self.s: E = None
        self.txt = txt

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

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

d = A("d")
h = B("h")
f = C("f")
k = D("k")
l = E("l")
g = B("g")

d.u = g
d.y = l
d.o = k
h.y = l
h.p = l
h.v = f
h.q = g
f.r = l
f.v = l
f.s = l
f.q = h
k.u = l
k.x = d
k.v = d
l.x = d
l.v = f
l.z = f
g.y = l
g.p = l
g.v = f
g.q = h
assert d.y.x.o.u.txt == "l"