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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: C = None
        self.u: A = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
f = C("f")
m = D("m")
k = E("k")
d = E("d")
h = E("h")

j.x = m
j.y = a
j.r = a
j.s = f
j.w = f
a.t = f
a.z = f
a.u = j
f.x = h
f.s = j
m.t = d
m.o = j
m.x = a
k.v = m
k.q = d
k.x = h
k.r = a
d.v = m
d.q = k
d.x = h
d.r = a
h.v = m
h.q = k
h.x = d
h.r = a
assert j.s.s.x.x.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: B = None
        self.r: B = None
        self.s: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: C = None
        self.u: A = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
f = C("f")
m = D("m")
k = E("k")
d = E("d")
h = E("h")

j.x = m
j.y = a
j.r = a
j.s = f
j.w = f
a.t = f
a.z = f
a.u = j
f.x = h
f.s = j
m.t = d
m.o = j
m.x = a
k.v = m
k.q = d
k.x = h
k.r = a
d.v = m
d.q = k
d.x = h
d.r = a
h.v = m
h.q = k
h.x = d
h.r = a
assert j.s.s.x.x.u.r.txt == "a"