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

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

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

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

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

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

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

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

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

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

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

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

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