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

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

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

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

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

b = A("b")
l = B("l")
h = C("h")
j = D("j")
k = E("k")
f = E("f")
d = C("d")
i = B("i")

b.u = f
b.r = l
l.r = i
l.y = i
l.w = b
l.x = b
l.o = d
h.w = d
j.w = b
j.u = b
j.t = f
j.v = f
j.s = f
k.t = b
k.w = l
f.t = b
f.w = i
d.w = h
i.r = l
i.y = l
i.w = b
i.x = b
i.o = d
assert k.w.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

b = A("b")
l = B("l")
h = C("h")
j = D("j")
k = E("k")
f = E("f")
d = C("d")
i = B("i")

b.u = f
b.r = l
l.r = i
l.y = i
l.w = b
l.x = b
l.o = d
h.w = d
j.w = b
j.u = b
j.t = f
j.v = f
j.s = f
k.t = b
k.w = l
f.t = b
f.w = i
d.w = h
i.r = l
i.y = l
i.w = b
i.x = b
i.o = d
assert k.w.r.y.txt == "l"